Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuke-dimensions

Package Overview
Dependencies
Maintainers
3
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-dimensions

屏幕参数

  • 2.3.12
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Dimensions

  • category: API
  • chinese: 屏幕参数
  • type: API 能力

何时使用

由于 weex 容器不支持 height : 100% ,当你需要获取屏幕宽高的 rem 数值时并设置样式时,需要 Dimensions 组件。

API

获取尺寸: Dimensions.get('window/screen')

获取 window 或 screen 的尺寸,默认竖屏

// 获取屏幕宽高的 rem 数值
let { height, width } = Dimensions.get('window');

获取横屏属性: Dimensions.getWindowInfo(isLandscape)

isLandscape 为 true 时,返回横屏宽高。

需当前页面在容器横屏下打开,否则将出现不可预料的数值

// 获取横屏模式下宽高
let { height, width } = Dimensions.getWindowInfo(true);

其他

  • bug、建议联系 @翊晨
  • 钉钉交流群

Keywords

FAQs

Package last updated on 26 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc